package day1107_3;

import java.io.*;

public class T3 {
    public static void main(String[] args) throws IOException {
        BufferedReader br=
                new BufferedReader( new FileReader("D:\\k.txt") );//1.创建BufferedReader br读取 D:\\k.txt
        BufferedWriter bw=
                new BufferedWriter( new FileWriter("D:\\k3.txt"));

        String  line=null;  //2.while读取文件中的一行文字赋值给变量line
        while(  (line=br.readLine())  !=  null   ){
            System.out.println(line);
            bw.write(line);//2
        }
        bw.close();
        br.close();//3.br的close()
    }
}
